package com.ctgu.demo.error;

public enum EmBusinessError implements CommonError{

    //10001通用错误类型10001
    PARAMETER_VALIDATION_ERROR(10001,"参数不合法"),

    UNKNOWN_ERROR(10002, "未知错误"),

    //20000用户相关信息错误定义
    USER_NOT_EXIST(20001, "用户不存在"),

    USER_LOGIN_FAIL(20002, "用户登陆失败"),

    //30000图书相关信息错误定义
    BOOK_NOT_EXIST(30001,"图书不存在"),

    //40000电影相关信息错误定义
    MOVIE_NOT_EXIST(40001,"电影不存在"),

    //50000音乐相关信息错误定义
    MUSIC_NOT_EXIST(50001,"音乐不存在"),

    //60000管理员相关信息错误定义
    ADMIN_NOT_EXIST(60001,"管理员不存在"),

    ADMIN_LOGIN_FAIL(60002, "管理员登陆失败")

    //
    ;

    private EmBusinessError(int errCode, String errMsg) {
        this.errCode = errCode;
        this.errMsg = errMsg;
    }

    private int errCode;
    private String errMsg;


    @Override
    public int getErrCode() {
        return this.errCode;
    }

    @Override
    public String getErrMsg() {
        return this.errMsg;
    }

    @Override
    public CommonError setErrMsg(String errMsg) {
        this.errMsg = errMsg;
        return this;
    }
}
